package com.museyu.model;

import lombok.Data;

@Data
public class Card {
    private String suit;    // 花色
    private String value;   // 点数
    private boolean isJoker; // 是否是鬼牌
    
    public Card(String suit, String value) {
        this.suit = suit;
        this.value = value;
        this.isJoker = false;
    }
    
    public Card(boolean isJoker) {
        this.isJoker = isJoker;
        if (isJoker) {
            this.suit = "JOKER";
            this.value = "JOKER";
        }
    }
    
    public int getNumericValue() {
        if (isJoker) {
            return 0; // 鬼牌需要玩家指定点数
        }
        
        switch (value) {
            case "A": return 1;
            case "J": return 11;
            case "Q": return 12;
            case "K": return 13;
            default: return Integer.parseInt(value);
        }
    }
} 